package com.significantfiles.snapshot.engine.io;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

import org.jboss.marshalling.ByteOutput;

public class FileByteOutput implements ByteOutput {

	private FileOutputStream fout;

	public FileByteOutput(final File file) throws FileNotFoundException {
		if (file == null)
			throw new NullPointerException();
		
		this.fout = new FileOutputStream( file );
	}

	@Override
	public void write(int arg0) throws IOException {
		this.fout.write( arg0 );
	}

	@Override
	public void write(byte[] arg0) throws IOException {
		this.fout.write( arg0 );
	}

	@Override
	public void write(byte[] arg0, int arg1, int arg2) throws IOException {
		this.fout.write(arg0, arg1, arg2);
	}

	@Override
	public void close() throws IOException {
		this.fout.close();
	}

	@Override
	public void flush() throws IOException {
		this.fout.flush();
	}

}
